/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package model.game.disaster.plugin;

import java.awt.Image;
import java.util.Random;
import model.game.GameInterface;
import model.game.disaster.Disaster;
import model.utility.ImageUtility;

/**
 * Theft, lost maximum 100 money at the end of day. 10% chance
 */
public class Day extends Disaster {

  /**
   * Keeps track whether this disaster is active
   */
  private boolean active_;

  /**
   * Constructor
   */
  public Day(GameInterface game) {
    super(game);
    active_ = false;
  }

  @Override
  public String getName() {
    return "Day";
  }

  @Override
  public String getDescription() {
    return "Day";
  }

  @Override
  public void advanceDay() {
  }

  @Override
  public void advanceTime() {
    if (game_.getGameTime().getDayTime() != game_.getConstants().getDayLength()-1) {
      active_ = true;
    } else {
      active_ = false;
    }
  }

  @Override
  public boolean isActive() {
    return active_;
  }

  public Image getImage() {
    return ImageUtility.loadImage("resources/pictures/disaster/day.png");
  }

}
